/*
 * @Author: Warren
 * @Date: 2025-04-11 08:53:48
 * @LastEditors: Warren
 * @LastEditTime: 2025-06-09 10:00:07
 * @FilePath: /nest-web/src/modules/test/test.controller.ts
 * @Description: 请填写文件说明
 */
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { TestService } from './test.service';
import { QueryTestDto } from './dto/test.dto';
import { UpdateTestDto } from './dto/update-test.dto';

@Controller('test')
export class TestController {
    constructor(private readonly testService: TestService) { }

  @Post()
    create( ){
        return '';
    }

  @Get('query')
  async findT1(@Query() queryTest:QueryTestDto) {
      console.log(queryTest);

      await new Promise(resolve => setTimeout(resolve, 10000)); // 延时2秒

      return 't1'
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
      return this.testService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateTestDto: UpdateTestDto) {
      return this.testService.update(+id, updateTestDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
      return this.testService.remove(+id);
  }
}
